package code

const (
	Success     = 200
	Error       = 400
	ParamErr    = 1001
	SaveErr     = 1002
	DelErr      = 1003
	SysErr      = 1004
	OperatorErr = 1005
	UploadrErr  = 1006
)

var errMsg = map[int]string{
	ParamErr:    "参数错误",
	SaveErr:     "保存失败",
	DelErr:      "删除失败",
	SysErr:      "系统错误",
	OperatorErr: "操作失败",
	UploadrErr:  "上传失败",
}

func ErrMsg(errCode int) string {
	if msg, ok := errMsg[errCode]; ok {
		return msg
	} else {
		return "未知错误"
	}
}
